# Maintainer: Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>

_realname=trompeloeil
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=31
pkgrel=1
pkgdesc="Header only C++14 mocking framework (mingw-w64)"
arch=('any')
url='https://github.com/rollbear/trompeloeil'
checkdepends=("${MINGW_PACKAGE_PREFIX}-gcc")

license=('Boost')
source=(${_realname}-${pkgver}.tar.gz::https://github.com/rollbear/trompeloeil/archive/v${pkgver}.tar.gz)
sha256sums=('04ce72ad343b816a06e65efa115620856a35b50bd0f6de0fde87fc93cf2a8cec')



check() {
  rm -rf "${srcdir}/test-${MINGW_CHOST}"
  mkdir -p "${srcdir}/test-${MINGW_CHOST}"
  cd "${srcdir}/test-${MINGW_CHOST}"
  ${MINGW_PREFIX}/bin/g++ -std=c++14 -lpthread \
	  		  ../trompeloeil-${pkgver}/test/thread_terror.cpp \
	    		  -I../trompeloeil-${pkgver}/include/
  ./a.exe
}

package() {
  cd "${srcdir}/trompeloeil-${pkgver}"
  mkdir -p "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}"
  install -m644 LICENSE_1_0.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE_1_0.txt"
  mkdir -p "${pkgdir}${MINGW_PREFIX}/include/"
  install -m644 include/trompeloeil.hpp  "${pkgdir}${MINGW_PREFIX}/include/"
}
